package com.moyun.zbmy.youxian.ui.activities;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.githang.statusbar.StatusBarCompat;
import com.moyun.zbmy.youxian.ui.fragment.CivSubFragment;
import com.moyun.zbmy.youxian.ui.fragment.CultureTravelFragment;
import com.ruihang.generalibrary.ui.widget.CustomFontTextView;
import com.moyun.zbmy.youxian.R;
import com.moyun.zbmy.youxian.base.BaseActivity;
import com.moyun.zbmy.youxian.ui.fragment.TvFragment;
import com.moyun.zbmy.youxian.ui.widget.BasePlayerView;

import butterknife.BindView;
import butterknife.ButterKnife;


public class CivActivity extends FragmentActivity {
    private String channelUrl,title ;

    @BindView(R.id.title_top_logo_layout)
    protected LinearLayout title_top_logo_layout;
    @BindView(R.id.title_top_title)
    protected CustomFontTextView title_top_title;
    @BindView(R.id.title_top_back)
    protected ImageView title_top_back;

    protected BasePlayerView videoPlayer;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zhibo_root);
        ButterKnife.bind(this);
        title_top_logo_layout.setVisibility(View.GONE);
        title_top_title.setVisibility(View.VISIBLE);



        StatusBarCompat.setStatusBarColor(this, getResources().getColor(R.color.white));

        if(!TextUtils.isEmpty(getIntent().getStringExtra(BaseActivity.EX_URL))){
            channelUrl = getIntent().getStringExtra(BaseActivity.EX_URL);
        }

        if(!TextUtils.isEmpty(getIntent().getStringExtra(BaseActivity.EX_TITLE))){
            title = getIntent().getStringExtra(BaseActivity.EX_TITLE);
            title_top_title.setText(title);

        }



        Bundle bundle = new Bundle();
        bundle.putString(BaseActivity.EX_URL, channelUrl);



        CivSubFragment fragment = new CivSubFragment();
        fragment.setArguments(bundle);
        getSupportFragmentManager()
                .beginTransaction()
                .add(R.id.fragment_container,fragment)
                .commit();

        title_top_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }



}
